//
//  TipController.m
//  village_ios
//
//  Created by mac on 2019/8/11.
//  Copyright © 2019 com.sw.village. All rights reserved.
//

#import "BaseTipController.h"

@interface BaseTipController ()
@property (weak, nonatomic) IBOutlet UIImageView *tipImageView;
@property (weak, nonatomic) IBOutlet UILabel *tipLabel;
@property (weak, nonatomic) IBOutlet UIButton *doneButton;

@property (copy, nonatomic) TipSuccess tipSuccess;
@end

@implementation BaseTipController

- (void)viewDidLoad {
    [super viewDidLoad];
    if (self.tipIcon) {
        self.tipImageView.image = [UIImage imageNamed:self.tipIcon];
    }
    if (self.tipTitle) {
        self.tipLabel.text = self.tipTitle;
    }
    // Do any additional setup after loading the view.
}
//从导航
+ (void)presentNaviController:(id)sourceVC  success:(TipSuccess)success{
    
    BaseTipController *vc = [BaseTipController instanceWithStoryBoard];
    vc.tipSuccess = success;
    UINavigationController *navi = [[UINavigationController alloc]initWithRootViewController:vc];
    [sourceVC presentViewController:navi animated:YES completion:nil];
}

- (IBAction)toDone:(id)sender {
    
    [self dismissViewControllerAnimated:YES completion:^{
        if(self.tipSuccess){
            self.tipSuccess();
        }
    }];
}

@end
